home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 25
/
CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso
/
CUCD
/
WWW
/
http
/
www.wirenet.co.uk
/
files
/
Dashboard2.lha
/
Dashboard2
/
AmiTCP
/
bin
/
Fetch
< prev
next >
Wrap
Text File
|
1998-03-27
|
3KB
|
86 lines
/*
$VER: Fetch 2.0 (26.3.98)
(c) Neil Bothwick
Gets mail and/or news, retrying until a connection
is made or a maximum number of retries is reached
*/
/* ;;;Change these to suit your setup */
SystemName = 'Wirenet' /* The name of your Internet system in Thor */
Logging = 1 /* Set to 1 to enable logging, 0 to disable it */
LogFile = 'UUSpool:Info.log' /* DO NOT use logging unless you have at least Thor 2.3 */
;;;
/* ;;;Don't change anything below here */
arg option
options results
address command
options failat 21
;;;
/* ;;;Check to see if fetch is already running */
'checkcmd >NIL: GetTCP'
if RC = 0 then call ExitMsg('You are already collecting mail or news')
;;;
/* ;;;Execute PreFetch script */
if exists('Wirenet:UserScripts/PreFetch') then address command 'Wirenet:UserScripts/PreFetch'
;;;
/* ;;;Build command string */
NumSockets = getclip('NewsSockets')
MaxTries = getclip('MaxTries')
CmdStr = GetVar('Thor/ThorPath')'bin/GetTCP' SystemName 'PUBSCREEN "" GETONLY'
MailStr = 'DELETE PASSWORD' getclip('Password') 'MAILSERVER' getclip('MailServer') 'USERNAME' getclip('MailBox')
NewsStr = 'NEWSSERVER' getclip('NewsServer') 'SOCKETS' NumSockets
if option = '' then do
choice = rtezrequest('Fetch Mail, News or All?','_All|_Mail|_News|_Cancel','Fetch','rt_reqpos = reqpos_centerscr')
select
when choice = 1 then option = 'ALL'
when choice = 2 then option = 'MAIL'
when choice = 3 then option = 'NEWS'
otherwise exit
end
end
select
when option = 'MAIL' then do
CmdStr = CmdStr 'NONEWS' MailStr
end
when option = 'NEWS' then do
CmdStr = CmdStr 'NOMAIL' NewsStr
end
when option = 'ALL' then do
CmdStr = CmdStr MailStr NewsStr
end
otherwise ExitMsg('Usage: Fetch Mail|News|All')
end
;;;
/* ;;;Call ParseThor to remove any batched mail or news in tcp_tmp */
'Wirenet:bin/ParseThor'
;;;
/* ;;;Call GetTCP until successful or max retries reached */
do try = 1 to MaxTries
if Logging = 1 then do
TempLog = 'T:Fetch.'||time(s)
CmdStr = CmdStr 'LOGFILE' TempLog
end
CmdStr
if Logging = 1 then 'run >NIL: ShowLog' TempLog req log info
if RC=0 then do
leave try
end
end
if try > MaxTries then ExitMsg('Failed to get mail after' MaxTries 'attempts')
;;;
/* ;;;Execute PostFetch script */
if exists('Wirenet:UserScripts/PostFetch') then address command 'Wirenet:UserScripts/PostFetch'
exit
;;;
/* ;;;Exit with a message */
ExitMsg: Procedure
parse arg Msg
call rtezrequest(Msg,' OK ','Fetch error','rt_reqpos = reqpos_centerscr')
exit
return
;;;